package com.model;

import java.io.Serializable;

public class Page implements Serializable {

	private static final long serialVersionUID = -3198048449643774660L;

    // 当前页
	private int pagenow = 1;
	// 总页数
	private int pageCount;
	// 查询条数
	private int pageSize = 10;
	// 总条数
	private int totalCount;

	private int startPos;

	public int getPagenow() {
		return pagenow;
	}

	public void setPagenow(int pagenow) {
		this.pagenow = pagenow;
	}

	public int getPageCount() {
		pageCount = totalCount / pageSize;
		return (totalCount % pageSize == 0) ? pageCount : pageCount + 1;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getStartPos() {
		return (pagenow - 1) * pageSize;
	}

	public void setStartPos(int startPos) {
		this.startPos = startPos;
	}

	public Page(int totalCount, int pagenow) {
		this.pagenow = pagenow;
		this.totalCount = totalCount;
	}

	public Page(int pagenow, int pageSize, int totalCount) {
		super();
		this.pagenow = pagenow;
		this.pageSize = pageSize;
		this.totalCount = totalCount;
	}

}
